Refinement Strategies for Inductive Leaming of Simple Prolog Programs
نویسندگان
چکیده
T h i s paper ex tends Shap i ro ' s M o d e l Inference System for syn thes iz ing logic p rog rams f r o m examples of i n p u t / o u t p u t behav io r . A new ref inement ope ra to r for clause genera t i on , based u p o n the d e c o m p o s i t i o n o f P ro l og p rog rams i n t o skeletons, basic P ro l og p rog rams w i t h a we l l unde rs tood c o n t r o l f l ow, a n d techniques, s t a n d a r d P r o l o g p r o g r a m m i n g pract ices is descr ibed. Shap i ro ' s o r i g i na l sys tem is i n t r o duced , skeletons and techniques are discussed, a n d s imp le examples are p r o v i d e d , to f am i l i a r ize the reader w i t h t he necessary t e rm ino logy . T h e M o d e l Inference Sys tem equ ipped w i t h th is new re f inement ope ra to r is compa red a n d cont ras ted w i t h the o r i g i na l vers ion presented by Shap i ro . T h e s t rengths a n d weaknesses o f app l y i n g skeletons a n d techniques to syn thes iz ing P r o l o g p rog rams is discussed. 1 I n t r o d u c t i o n I n d u c t i v e l ea rn ing of concepts, g iven a set of examples a n d coun te rexamples , has been g iven a l o t of a t t e n t i o n i n the A r t i f i c i a l In te l l igence c o m m u n i t y . T h i s paper concerns a special case of i n d u c t i v e l e a r n i n g , syn thes iz ing P ro log p rog rams f r o m examples o f t he i r i n p u t / o u t p u t behav io r . A n i n c r e m e n t a l i n d u c t i v e inference a l g o r i t h m was developed in [Shap i ro , 1983] fo r syn thes iz ing logic p rog rams . Shap i ro n a m e d his i m p l e m e n t a t i o n the M o d e l Inference Sys tem ( M I S ) . M I S has several componen ts i n c l u d i n g : de tec t ion and remova l o f a false clause, de tec t i on of the i n a b i l i t y to prove a goa l k n o w n to be t r u e , and the a b i l i t y to f i nd a new clause to j u s t i f y t he k n o w n t r u t h o f a goa l . Anyone e x p e r i m e n t i n g w i t h M I S q u i c k l y discovers t h a t some p ro g rams are easy to l ea rn , o thers can be synthesized w i t h d i f f i cu l t y , and o thers are beyond the scope of the syst e m . T h e reason fo r t he v a r i a t i o n in pe r fo rmance can be t raced to the re f inement opera to r used to p roduce new clauses, a n d the search s t ra tegy emp loyed to de te rm ine i f t he new clause co r rec t l y imp l ies the examples . Hence the re f inement ope ra to r , due to i t s in f luence u p o n the scope o f t he sys tem, is t he foca l p o i n t fo r th i s paper . T h i s paper w i l l descr ibe M I S w i t h one o f i t s re f inement L e o n S. S te r l i ng Computer Engineering & Science Dept. Case Western Reserve University Cleveland, Ohio 44106 U.S.A. opera tors and w i t h a new re f inement opera to r based on w o r k on decompos ing P ro log p rog rams i n t o skeletons , basic P ro l og p rog rams w i t h a we l l unde rs tood cont r o l f l ow , and techniques, s t a n d a r d P ro log p r o g r a m m i n g pract ices. In cont ras t to Shap i ro 's re f inement opera to r , wh i ch checks and adds new clauses one at a t i m e , the new opera to r produces a l l re f inements and then checks the clauses generated. In fac t , every t i m e M I S t r ies to learn a new clause the re f inement opera to r goes t h r o u g h the same order o f clause genera t ion . By check ing p rev ious ly re fu ted clauses, the p r o g r a m ref ra ins f r o m repea t ing i ts mis takes. We w i l l denote M I S equ ipped w i t h our new opera to r as the M o d e l Inference System w i t h Skeletons and Techniques ( M I S S T ) . I n M I S S T the re f inement opera to r consists o f two phases. T h e f i rs t phase matches the necessary d a t a s t ruc tu res w i t h a skeleton an a p p r o p r i a t e con t ro l f low for the p r o g r a m . T h i s genera t ion of a skeleton is accomp l i shed by c rea t i ng a t e m p l a t e us ing on l y the i n p u t a rgumen ts f r o m the p r o g r a m to be synthes ized. Once the skeleton is c reated, the second phase enhances the skeleton by a p p l y i n g a techn ique to i t . Each technique w i l l generate a p r o g r a m to be checked for correctness. Examp les o f the types o f p r o g r a m s w h i c h are ha rd o r imposs ib le to l ea rn and those easy to learn w i l l be given for each sys tem. We w i l l examine the i m p l i c a t i o n s o f the resul ts and c i te areas for f u t u r e research. 2 T h e M o d e l In fe rence Sys tem T h e M o d e l Inference Sys tem is an i m p l e m e n t a t i o n o f an i n c r e m e n t a l i n d u c t i v e inference a l g o r i t h m . G i v e n a set o f examples and counte rexamples o f a new concept , M I S produces a set of H o r n clauses to represent the concept . Whenever the cu r ren t set of clauses prove a counterexa m p l e t rue , the p r o o f tree is used to de te rm ine the f au l t y clause in the set w h i c h is then removed . I f there exists an examp le no t exp la ined by the cur ren t set of clauses, a new clause is generated us ing a re f inement opera to r . A m a j o r assump t i on o f the system is t h a t an oracle exists w h i c h knows the t r u t h o r fa ls i t y o f any pa r t i cu l a r g r o u n d instance of the concept to be learned. T h e re f inement opera to r de termines the t ype o f P ro log p rog rams w h i c h can e a s i l y / n o t easi ly be learned t h r o u g h M I S . One re f inement opera to r g iven in [Shap i ro , 1983] was special ized fo r genera t ing clauses for de f in i te clause Kirschenbaum and Sterling 757 Ref inement Strategies for Induc t i ve Learn ing Of Simple Prolog Programs g r a m m a r s whereas a second opera to r was presented as a more general opera to r . Each opera to r was designed for syn thes iz ing a d i f ferent t ype o f p r o g r a m . In th i s paper, we use the general ised re f inement ope ra to r fo r a l l compar isons w i t h M I S S T . M I S needs to have access to ce r t a i n knowledge to successful ly synthesize a logic p r o g r a m . T h e f o l l o w i n g t w o types o f knowledge are specif ic to the i n tended ta rge t p r o g r a m a n d are supp l ied by the user. Dec la ra t ions a b o u t the t ype a n d m o d e o f each var iab le are used to de te rm ine how the var iab les w i l l be i n s t a n t i a t e d . I n f o r m a t i o n a b o u t ' a l l owab le ' predicates guides clause c rea t ion . An added goa l i s re la ted to the o ther goals in the clause t h r o u g h the i n s t a n t i a t i o n o f var iab les as specif ied by the t ype a n d m o d e dec la ra t ions . O the r knowledge is i nc l uded as p a r t o f the M I S database. For examp le , there is a l i s t of i n s t a n t i a t i o n s for each t y p e . A l i s t va r iab le can be i n s t a n t i a t e d to [ ] or [X|X.]. T h e general re f inement opera to r pe r fo rms i n the f o l -
منابع مشابه
Learning in Clausal Logic: A Perspective on Inductive Logic Programming
Inductive logic programming is a form of machine learning from examples which employs the representation formalism of clausal logic. One of the earliest inductive logic programming systems was Ehud Shapiro’s Model Inference System [90], which could synthesise simple recursive programs like append/3. Many of the techniques devised by Shapiro, such as top-down search of program clauses by refinem...
متن کاملFirst-order theories for pure Prolog programs with negation
The standard theory of logic programming is not applicable to Prolog programs even not to pure code. Modifying the theory to take account of reality more is the motivation of this article. For this purpose we introduce the `-completion and the inductive extension of a logic program. Both are first-order theories in a language with operators for success, failure and termination of goals. The `-c...
متن کاملTheory Refinement of Bayesian Logic Programs
Bayesian Logic Programs (BLP) [8][9] is a powerful and elegant framework for combining the expressiveness of first order logic with Bayesian networks. They can represent both Bayesian networks and logic programs, and their kernel in Prolog is an adaptation of an usual Prolog metainterpreter. It has been successfully compared to other such proposals in the literature. In this paper, we present a...
متن کاملProving Inductive Properties of Prolog Programs in Second-Order Intuitionistic Logic
We use second-order intuitionistic logic for two purposes in this paper: first, to formulate a large class of circumscriptive queries about logic programs; and second, to formulate a class of induction schemata that can be used to answer these queries. Then, applying the techniques of intuitionistic logic programming, we develop an interpreter (written in PROLOG) that constructs inductive proof...
متن کاملInductive Inference of Prolog Programs with Linear Data Dependency from Positive Data
We study inductive inference of Prolog programs from positive examples of a target predicate. Shinohara showed in 1991 that the class of linear Prologs with at most m clauses is identi able in the limit from positive data only about a target predicate. However, linear Prologs are not allowed to have local variables, which are variables occurring in the body but not in the head. In this paper, w...
متن کاملVerification of Starlog Programs
Starlog is a purely declarative, temporal, logic programming language. It supports both bottom-up and top-down execution and is well-suited to writing reactive programs. This paper presents a simple methodology for proving Starlog programs correct with respect to predicate calculus specifications. The promise of declarative programming languages is that they make it easier to write provably cor...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
دوره شماره
صفحات -
تاریخ انتشار 1991